-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support to register plugins by module path #373
base: master
Are you sure you want to change the base?
add support to register plugins by module path #373
Conversation
9c9f46f
to
36d9902
Compare
just discovered the dev docs so PR likely will need some work |
I've thought about this and can see the use for it. However, the |
fair enough, I'm aware discover is a core func and backwards compatibility is key. regarding complexity of this PR: the first 2 commits touch a lot of code, but do not change ANY functionality. just a refactor to avoid duplicate code. this is in preparation for the 3rd commit which introduces the actual new functionality: |
would it be worth splitting this PR so we can tackle the changes separately? commit 1 removes duplicate code commit 2 move the code for discovering a module to it's own function, so it's not embedded in the discover function. notice it does introduce a small change! commit 3 is where we add the new functionallity. |
TLDR: this PR adds support to register a plugin with the path to a python file(module). allowing you to register individual files without having to change your folder structure.
Description:
atm pyblish only supports registering a plugin either
the paths are also saved in registered paths, and are returned by
i chose to reuse this variable since it requires minimum changes to the codebase, and is a lot cleaner than having a second var.
it also reads nice, registered paths contains all registered paths. both file and folder.
this was tested with pyblish QML and lite.
regarding potentially breaking old pipelines/ pyblish setups.
since before a file path was not allowed in registered paths. no one will have any workflows with files in the registered plugin paths.
this leads to my assumption it will be backwards compatible.
the main function using plugin_paths in the pyblish API is discover. which now handles filepaths correctly.
the CLI does not require changes i believe.
incase there is a test that checks if registered paths does not contain a filepath, this test will now fail.